<div class="sidebar-shortcuts" id="sidebar-shortcuts">
    <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
        <button class="btn btn-success">
            <i class="ace-icon fa fa-signal"></i>
        </button>

        <button class="btn btn-info">
            <i class="ace-icon fa fa-pencil"></i>
        </button>

        <button class="btn btn-warning">
            <i class="ace-icon fa fa-users"></i>
        </button>

        <button class="btn btn-danger">
            <i class="ace-icon fa fa-cogs"></i>
        </button>
    </div>

    <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
        <span class="btn btn-success"></span>

        <span class="btn btn-info"></span>

        <span class="btn btn-warning"></span>

        <span class="btn btn-danger"></span>
    </div>
</div><!-- /.sidebar-shortcuts -->
<div id="nav-div">


    <ul class="nav nav-list" id="sidebar-menu">
<!--        <li data-level="1" v-for="r in resources" @click="changeArrow(r)">-->

<!--            <a href="javascript:void(0);" class="dropdown-toggle"-->
<!--               :haschild="r.check_Child_State==0?'true':'false'">-->
<!--                <i class="menu-icon " :class="r.icon"></i>-->
<!--                <span class="menu-text" style="vertical-align: middle;"> {{r.name}} </span>-->
<!--                <b class="arrow" :class="r.arrow?' fa fa-angle-down':' fa fa-angle-right'"></b>-->
<!--            </a>-->
<!--            <b class="arrow"></b>-->

<!--            <ul class="submenu nav-hide" style="display:none;" v-if="r.check_Child_State==0">-->
<!--                <li data-level="2" v-for="child in r.children">-->

<!--                    <a :href="child.url" :id=`menu_${child.url.replace(/\//g,'_')}` haschild="false">-->
<!--                        <i class="menu-icon " :class="child.icon"></i>-->
<!--                        <span class="menu-text"-->
<!--                        > {{child.name}} </span>-->
<!--                    </a>-->
<!--                    <b class="arrow"></b>-->

<!--                </li>-->
<!--            </ul>-->
<!--        </li>-->

        <li data-level="1">

        <a
        href="javascript:void(0);" class="dropdown-toggle"
        haschild="true"
        >
        <i class="menu-icon fa fa-lastfm"></i>
        <span class="menu-text"
        style="vertical-align: middle;"
        > 单位管理 </span>
        <b class="arrow fa fa-angle-down"></b>
        </a>
        <b class="arrow"></b>

        <ul class="submenu nav-hide" style="display:none;">
        <li data-level="2">

        <a
        href="manager/office/office-detail"
        id="menu_managercompanydetail"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 单位信息 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/user/user"
        id="menu_managercompanyaccounts"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 单位账号 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/work/company/work"
        id="menu_managercompanywork"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 电子台账 </span>
        </a>
        <b class="arrow"></b>

        </li>
        </ul>
        </li>
        <li data-level="1">

        <a
        href="javascript:void(0);" class="dropdown-toggle"
        haschild="true"
        >
        <i class="menu-icon fa fa-puzzle-piece"></i>
        <span class="menu-text"
        style="vertical-align: middle;"
        > 业务管理 </span>
        <b class="arrow fa fa-angle-down"></b>
        </a>
        <b class="arrow"></b>

        <ul class="submenu nav-hide" style="display:none;">
        <li data-level="2">

        <a
        href="manager/admin/work"
        id="menu_manageradminwork"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 电子台账 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/qualification/index"
        id="menu_managerqualificationindex"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 资质审核 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="html/demand/index"
        id="menu_managerdemandindex"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 服务需求 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/examine/index"
        id="menu_managerexamineindex"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > 考核管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/app/index"
        id="menu_managerappindex"
        haschild="false"
        >
        <i class="menu-icon "></i>
        <span class="menu-text"
        > APP管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/statute/index"
        id="menu_managerstatuteindex"
        haschild="false"
        >
        <i class="menu-icon fa fa-bolt"></i>
        <span class="menu-text"
        > 法律法规 </span>
        </a>
        <b class="arrow"></b>

        </li>
        </ul>
        </li>
        <li data-level="1">

        <a
        href="javascript:void(0);" class="dropdown-toggle"
        haschild="true"
        >
        <i class="menu-icon fa fa-group"></i>
        <span class="menu-text"
        style="vertical-align: middle;"
        > 机构用户 </span>
        <b class="arrow fa fa-angle-down"></b>
        </a>
        <b class="arrow"></b>

        <ul class="submenu nav-hide" style="display:none;">
        <li data-level="2">

        <a
        href="manager/area/area"
        id="menu_managerarea"
        haschild="false"
        >
        <i class="menu-icon fa fa-globe"></i>
        <span class="menu-text"
        > 区域管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/office/office"
        id="menu_manageroffice"
        haschild="false"
        >
        <i class="menu-icon fa fa-sitemap"></i>
        <span class="menu-text"
        > 机构管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/user/user-list"
        id="menu_managersysuser"
        haschild="false"
        >
        <i class="menu-icon fa fa-user"></i>
        <span class="menu-text"
        > 用户管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/role/role"
        id="menu_managerrole"
        haschild="false"
        >
        <i class="menu-icon fa fa-graduation-cap"></i>
        <span class="menu-text"
        > 角色管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        </ul>
        </li>
        <li data-level="1">

        <a
        href="javascript:void(0);" class="dropdown-toggle"
        haschild="true"
        >
        <i class="menu-icon fa fa-cogs"></i>
        <span class="menu-text"
        style="vertical-align: middle;"
        > 系统管理 </span>
        <b class="arrow fa fa-angle-down"></b>
        </a>
        <b class="arrow"></b>

        <ul class="submenu nav-hide" style="display:none;">
        <li data-level="2">

        <a
        href="manager/menu/menu"
        id="menu_managermenu"
        haschild="false"
        >
        <i class="menu-icon fa fa-list"></i>
        <span class="menu-text"
        > 菜单配置 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/dict/dict"
        id="menu_managerdict"
        haschild="false"
        >
        <i class="menu-icon fa fa-calculator"></i>
        <span class="menu-text"
        > 字典管理 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/log/log"
        id="menu_managersyslog"
        haschild="false"
        >
        <i class="menu-icon fa fa-copy"></i>
        <span class="menu-text"
        > 日志查询 </span>
        </a>
        <b class="arrow"></b>

        </li>
        </ul>
        </li>
        <li data-level="1">

        <a
        href="javascript:void(0);" class="dropdown-toggle"
        haschild="true"
        >
        <i class="menu-icon fa fa-binoculars"></i>
        <span class="menu-text"
        style="vertical-align: middle;"
        > 系统监控 </span>
        <b class="arrow fa fa-angle-down"></b>
        </a>
        <b class="arrow"></b>

        <ul class="submenu nav-hide" style="display:none;">
        <li data-level="2">

        <a
        href="manager/ehcache/ehcache"
        id="menu_managermonitorehcache"
        haschild="false"
        >
        <i class="menu-icon fa fa-crosshairs"></i>
        <span class="menu-text"
        > Ehcache监控 </span>
        </a>
        <b class="arrow"></b>

        </li>
        <li data-level="2">

        <a
        href="manager/jvm/jvm"
        id="menu_managermonitorjvm"
        haschild="false"
        >
        <i class="menu-icon fa fa-flash"></i>
        <span class="menu-text"
        > jvm监控 </span>
        </a>
        <b class="arrow"></b>

        </li>
        </ul>
        </li>


    </ul><!-- /.nav-list -->
</div>
<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
    <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
       data-icon2="ace-icon fa fa-angle-double-right"></i>
</div>
<script>
    let vm = new Vue({
        el: "#nav-div",
        data: {
            resources: [],
        },
        methods: {
            changeArray: function () {
                let setting = {
                    data: {
                        simpleData: {
                            enable: true,
                            pIdKey: 'parentId'
                        }
                    }
                }
                let zTreeObj = $.fn.zTree.init($('#s'), setting, this.resources);

                this.resources = zTreeObj.getNodes();
                $.fn.zTree.destroy("s");


                for (let i = 0; i < this.resources.length; i++) {
                    //给arrow添加set/get方法
                    Vue.set(this.resources[i], "arrow", false)
                }

            },
            changeArrow: function (r) {

                r.arrow = !r.arrow;
            }
        },
        created: function () {

            let loginStr = sessionStorage.getItem("map");
            if (loginStr != undefined && loginStr.length > 0) {
                let map = JSON.parse(loginStr);
                let _resources = map.resources;

                this.resources = _resources;
                this.changeArray();
            }
        }
    });
</script>


